package cn.wellwan.mybatis.utils;

/**
 * creator: maokai
 * on: 2018/3/6
 * description:
 */
public enum Gender {
    MALE(1 , "男"), FEMALE(2 , "女");
    private int id;
    private String name;

    private Gender (int id , String name) {
        this.id = id;
        this.name = name;
    }

    public int getId () {
        return id;
    }

    public void setId (int id) {
        this.id = id;
    }

    public String getName () {
        return name;
    }

    public void setName (String name) {
        this.name = name;
    }

    public static Gender getGender (int var) {
        if (var == MALE.getId()) {
            return MALE;
        } else if (var == FEMALE.getId()) {
            return FEMALE;
        }
        return null;
    }
}
